package com.mallcloud.mall.app.controller;

import com.mallcloud.mall.common.core.util.R;
import com.mallcloud.mall.mall.api.entity.XglQRCodePaymentCouponViewModel;
import com.mallcloud.mall.mall.service.XglQRCodePaymentCouponViewService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "app-星光里二维码支付牌-电子券|手工券")
@Slf4j
@RestController
@AllArgsConstructor
@RequestMapping("/app/xglQRCodePaymentCoupon")
public class AppXglQRCodePaymentCouponController {
	private final XglQRCodePaymentCouponViewService xglQRCodePaymentCouponViewService;

	@ApiOperation("列表")
	@GetMapping("/listToday")
	public R<List<XglQRCodePaymentCouponViewModel>> list(XglQRCodePaymentCouponViewModel dto) {
		return R.ok(xglQRCodePaymentCouponViewService.listQRCodePaymentCoupon(dto));
	}

	@ApiOperation("查询详情")
	@GetMapping("/getInfo")
	public R<XglQRCodePaymentCouponViewModel> getInfo(XglQRCodePaymentCouponViewModel dto) {
		return R.ok(xglQRCodePaymentCouponViewService.getInfo(dto.getId()));
	}

}
